<?php
/**************************************************/
## @author: ALANKAR 
## Class Name - Model_Paypal (Contains all the functions related to paypal settings )
## Created By - Techmodi (14/05/2012)
/**************************************************/

class Model_Paypal extends Database 
{	
	## Constructor
	function Model_Paypal() {
		$this->paypal              = PAYPAL;
		$this->Database();
	}	


## Getting all the details from the paypal details 
function getDetailsFromPaypal(){
	$fields = array();
	$tables = array($this->paypal);
	$res    = $this->SelectData($fields,$tables,$where =array(),$order=array(),$group = array(),$limit,$offset,0);
	$result = $this->FetchAll($res);
	return $result;
	
}
function getDetail(){
	$fields = array();
	$tables = array($this->paypal);
	$res    = $this->SelectData($fields,$tables,$where =array(),$order=array(),$group = array(),$limit,$offset,0);
	$result = $this->FetchAll($res);
	return $result[0];
	
}
## Getting all the details from the paypal details 
function getDetailsFromPaypalById($paypalId){
	$fields = array();
	$tables = array($this->paypal);
	$res    = $this->SelectData($fields,$tables,$where =array("id ='".$paypalId."'"),$order=array(),$group = array(),$limit,$offset,0);
	$result = $this->FetchAll($res);
	return $result;
	
}
## Getting details from the paypal details 
function getDetailPaypalAccountById($paypalId){
	$fields = array();
	$tables = array($this->paypal);
	$res    = $this->SelectData($fields,$tables,$where =array("id ='".$paypalId."'"),$order=array(),$group = array(),$limit,$offset,0);
	$result = $this->FetchRow($res);
	return $result;
	
}

# updating details 
function UpdatePayPalDetails($array , $id){
	$this->UpdateData($this->paypal,$array,"id",$id,0);
}
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------*/		
}

?>
